From e608d39bb5f16db9c31368c4c67f8683b12e560a Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 14 Jul 2003 19:56:16 +0000 Subject: [PATCH] Commit incomplete clickable image maps in the hopes that someone else can run with that... --- gpsbabel/tiger.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gpsbabel/tiger.c b/gpsbabel/tiger.c index 8183b1e58..bafedc465 100644 --- a/gpsbabel/tiger.c +++ b/gpsbabel/tiger.c @@ -36,12 +36,24 @@ static char *genurl = NULL; static char *scale = "768"; int scalev; +/* + * The code bracketed by CLICKMAP is to generate clickable image maps + * for a web browser. It's functional, but is missing the math to do + * the projection transformations. Some trig geek can finish that. + */ +#if CLICKMAP +static char *clickmap = NULL; +#endif + static arglist_t tiger_args[] = { {"nolabels", &nolabels, "Suppress labels on generated pins."}, {"genurl", &genurl, "Generate file with lat/lon for centering map."}, {"scale", &scale, "Dimension in pixels of map."}, +#if CLICKMAP + {"clickmap", &clickmap, "Generate Clickable map web page."}, +#endif {0, 0, 0} }; @@ -132,6 +144,18 @@ tiger_disp(const waypoint *wpt) fprintf(file_out, "\n"); } +static void +map_plot(const waypoint *wpt) +{ + static int x,y; + + /* Replace with real math. */ + x+=10; + y+=10; + + fprintf(linkf, "\"%s\"\n",url, wpt->description); +} + static void data_write(void) { @@ -162,6 +186,20 @@ data_write(void) fprintf(urlf, "&iwd=%s&iht=%s", scale, scale); } fclose(urlf); +#if CLICKMAP + if (clickmap) { + linkf = fopen(clickmap, "w"); + if (linkf == NULL) { + fatal(MYNAME ": Cannot open '%s' for writing\n", + clickmap); + } + fprintf(linkf, "\n"); + waypt_disp_all(map_plot); + fprintf(linkf, "\n"); + fclose(linkf); + linkf = NULL; + } +#endif } } -- 2.30.2